<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>JSP</title>
</head>
<body>
    <sf:form action="/menu" method="post" modelAttribute="menu">
        <c:if test="${menu.id != null}">
            <sf:hidden path="id"/>
            <input type="hidden" name="_method" value="PUT">
        </c:if>
        菜单名：<sf:input path="name"/>
        <br>
        菜单链接：<sf:input path="url"/>
        <br>
        排序：<sf:input path="order"/>
        <br>
        父菜单：
        <%--<sf:select path="parent.id" items="${requestScope.menus}" itemValue="id" itemLabel="name" />--%>
        <sf:select path="parent.id">
            <sf:option value="" label="不选" ></sf:option>
            <sf:options itemValue="id" itemLabel="name" items="${requestScope.menus}"/>
        </sf:select>
        <br>
        <input type="submit" value="提交">
    </sf:form>
</body>
</html>
